package com.web.surf.sample.eshop.database.manager.services;

import java.util.List;

import com.web.surf.sample.eshop.database.dao.interfaces.IGoodsDao;
import com.web.surf.sample.eshop.database.manager.interfaces.IGoodsService;
import com.web.surf.sample.eshop.faces.core.AbstractBean;
import com.web.surf.sample.eshop.faces.managed.beans.GoodsBean;

/**
 * Implementation of interface for servicing goods
 * 
 * @author LukyanyukDV
 * @author SavenkoNV
 */
public class GoodsServiceImpl implements IGoodsService {

	private IGoodsDao goodsDao;

	public void setGoodsDao(IGoodsDao goodsDao) {
		this.goodsDao = goodsDao;
	}

	public List<AbstractBean> getSortedGoodsByPage(AbstractBean subcategory,
			String sortField, String sortDirection, int firstRow, int rowCount) {
		return goodsDao.getSortedGoodsByPage(subcategory, sortField,
				sortDirection, firstRow, rowCount);
	}

	public int getGoodsCountForSubcategory(AbstractBean subcategory) {
		return goodsDao.getGoodsCountForSubcategory(subcategory);
	}

	public GoodsBean getGoodsBean(String id) {
		return goodsDao.getGoodsBean(id);
	}
}